﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="standard-level.aspx.cs" Inherits="school_standard_level" MaintainScrollPositionOnPostback="true" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">

    <script src="../include/js/form.js" type="text/javascript"></script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="bodyContentTop" runat="Server">
    <h1>
        Standard Level</h1>
    <h3>
        How many standard and level have in selected school?.</h3>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="bodyContent" runat="Server">
    <div class="elements_inner_wrapper">
        <div id="contentBody">
            <div class="section">
                <div class="seperator">
                </div>
                <fieldset class="formouter">
                    <table cellpadding="3" cellspacing="3" width="100%">
                        <tr>
                            <td colspan="2">
                                <div class="row_curved" id="divSchoolList" runat="server" title="Example:UCSM, MIT, YTU">
                                    <label for="<%=ddlSchoolList.ClientID%>" class="mand_red">
                                        <asp:Label runat="server" Text="School" ID="Label2" /></label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:DropDownList AutoPostBack="True" runat="server" ID="ddlSchoolList" OnSelectedIndexChanged="ddlSchoolList_SelectedIndexChanged"
                                                DataSourceID="odsSchoolProfileList" DataTextField="ListText" DataValueField="ListValue" />
                                            <asp:ObjectDataSource ID="odsSchoolProfileList" runat="server" OldValuesParameterFormatString="original_{0}"
                                                SelectMethod="GetList" TypeName="SIS.BLL.ListingManager">
                                                <SelectParameters>
                                                    <asp:Parameter DefaultValue="1" Name="ListType" Type="Int32" />
                                                </SelectParameters>
                                            </asp:ObjectDataSource>
                                            <asp:RequiredFieldValidator ID="rfvSchoolList" ValidationGroup="StandardLevel" ControlToValidate="ddlSchoolList"
                                                runat="server" CssClass="validationErrorControl" Display="Dynamic" ErrorMessage="<br/>Please select a school name.<br/>"></asp:RequiredFieldValidator>
                                            &nbsp;&nbsp;
                                            <asp:Button Visible="false" runat="server" ID="btnShowStandardLevel" Text="Show"
                                                OnClick="btnShowStandardLevel_Click" />
                                        </span>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <div class="row_curved" id="divSchoolMajor" runat="server" title="Example:UCSM, MIT, YTU">
                                    <label for="<%=ddlSchoolMajor.ClientID%>" class="mand_red">
                                        <asp:Label runat="server" Text="Major" ID="Label1" /></label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:DropDownList AutoPostBack="True" runat="server" ID="ddlSchoolMajor" OnSelectedIndexChanged="ddlSchoolMajor_SelectedIndexChanged"
                                                DataSourceID="odsSchoolMajor" DataTextField="Description" DataValueField="SchoolMajorKey" />
                                            <asp:ObjectDataSource ID="odsSchoolMajor" runat="server" DeleteMethod="Delete" OldValuesParameterFormatString="original_{0}"
                                                SelectMethod="GetList" TypeName="SIS.BLL.SchoolMajorTableManager">
                                                <DeleteParameters>
                                                    <asp:Parameter Name="SchoolMajorKey" Type="Int32" />
                                                </DeleteParameters>
                                                <SelectParameters>
                                                    <asp:ControlParameter ControlID="ddlSchoolList" Name="SchoolKey" PropertyName="SelectedValue"
                                                        Type="Int32" />
                                                </SelectParameters>
                                            </asp:ObjectDataSource>
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ValidationGroup="StandardLevel"
                                                ControlToValidate="ddlSchoolList" runat="server" CssClass="validationErrorControl"
                                                Display="Dynamic" ErrorMessage="<br/>Please select a school name.<br/>"></asp:RequiredFieldValidator>
                                        </span>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <h2>
                                    Listing</h2>
                                <asp:GridView ID="grvStandardLevel" runat="server" AutoGenerateColumns="False" DataKeyNames="StandardLevelKey,SchoolKey,SchoolMajorKey"
                                    CellPadding="4" Width="550px" DataSourceID="ObjectDataSource1" ForeColor="#333333"
                                    GridLines="None" OnSelectedIndexChanged="grvStandardLevel_SelectedIndexChanged">
                                    <RowStyle BackColor="#EFF3FB" />
                                    <Columns>
                                        <asp:BoundField DataField="StandardLevelKey" HeaderText="StandardLevelKey" InsertVisible="False"
                                            ReadOnly="True" Visible="false" SortExpression="StandardLevelKey" />
                                        <asp:BoundField DataField="SchoolKey" HeaderText="SchoolKey" InsertVisible="False"
                                            ReadOnly="True" Visible="false" SortExpression="SchoolKey" />
                                        <asp:BoundField DataField="SchoolMajorKey" HeaderText="SchoolMajorKey" InsertVisible="False"
                                            ReadOnly="True" Visible="false" SortExpression="SchoolMajorKey" />
                                        <asp:BoundField DataField="StandardLevelCode" HeaderText="Code" SortExpression="StandardLevelCode" />
                                        <asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" />
                                        <asp:CheckBoxField DataField="Status" HeaderText="Status" SortExpression="Status" />
                                        <asp:BoundField DataField="CreatedDateTime" Visible="false" HeaderText="CreatedDateTime"
                                            SortExpression="CreatedDateTime" />
                                        <asp:BoundField DataField="ModifiedDateTime" HeaderText="ModifiedDateTime" SortExpression="ModifiedDateTime" />
                                        <asp:CommandField ButtonType="Button" ShowSelectButton="True" />
                                    </Columns>
                                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                                    <EmptyDataTemplate>
                                        Please add new standard level of selected school.
                                    </EmptyDataTemplate>
                                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                    <EditRowStyle BackColor="#2461BF" />
                                    <AlternatingRowStyle BackColor="White" />
                                </asp:GridView>
                                <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DataObjectTypeName="SIS.ENT.StandardLevelTable"
                                    DeleteMethod="Delete" OldValuesParameterFormatString="original_{0}" SelectMethod="GetList"
                                    TypeName="SIS.BLL.StandardLevelTableManager" UpdateMethod="Save">
                                    <SelectParameters>
                                        <asp:ControlParameter ControlID="ddlSchoolList" Name="SchoolKey" PropertyName="SelectedValue"
                                            Type="Int32" />
                                        <asp:ControlParameter ControlID="ddlSchoolMajor" Name="SchoolMajorKey" PropertyName="SelectedValue"
                                            Type="Int32" />
                                    </SelectParameters>
                                </asp:ObjectDataSource>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" valign="top">
                                <div>
                                    <asp:ValidationSummary ID="vsStandardLevel" runat="server" ValidationGroup="StandardLevel"
                                        ShowSummary="True" HeaderText="Please complete all highlighted fields of the form. Thank you."
                                        CssClass="errorSummary" />
                                    <asp:Label Visible="true" runat="server" Text="-1" ID="lblSchoolKey" />
                                    <asp:Label Visible="true" runat="server" Text="-1" ID="lblSchoolMajorKey" />
                                    <asp:Label Visible="true" runat="server" Text="-1" ID="lblStandardLevelKey" />
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td valign="top">
                                <h2>
                                    Standard Level Details
                                </h2>
                                <div class="row_curved" id="divStandardLevelCode" runat="server" title="Example:1st-CS, BEHS-8, 2nd-DIP">
                                    <label for="<%=txtStandardLevelCode.ClientID%>" class="mand_red">
                                        <asp:Label runat="server" Text="Code" ID="lblStandardLevelCode" /></label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:TextBox Width="220px" ID="txtStandardLevelCode" MaxLength="50" runat="server" />
                                            <asp:RequiredFieldValidator ID="rfvStandardLevelCode" ValidationGroup="StandardLevel"
                                                ControlToValidate="txtStandardLevelCode" runat="server" CssClass="validationErrorControl"
                                                Display="Dynamic" ErrorMessage=""></asp:RequiredFieldValidator>
                                        </span>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                                <div class="row_curved" id="divDescription" runat="server">
                                    <label for="<%=txtDescription.ClientID%>" class="mand_red">
                                        <asp:Label runat="server" Text="Description" ID="lblDescription" /></label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:TextBox Width="270px" ID="txtDescription" MaxLength="255" runat="server" />
                                            <asp:RequiredFieldValidator ID="rfvDescription" ValidationGroup="StandardLevel" ControlToValidate="txtDescription"
                                                runat="server" CssClass="validationErrorControl" Display="Dynamic" ErrorMessage=""></asp:RequiredFieldValidator>
                                        </span>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                                <div class="row_curved" id="divStatus" runat="server">
                                    <label for="<%=chkStatus.ClientID%>" class="mand_red">
                                        <asp:Label runat="server" Text="Status" ID="lblStatus" /></label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:CheckBox ID="chkStatus" runat="server" Text="" Checked="true" />
                                        </span>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <div class="row_curved" style="background-color: #efefef;" id="divButton" runat="server">
                                    <label>
                                        &nbsp;</label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:Button ID="btnSubmit" CssClass="button_normal_submit" Text="Save" ValidationGroup="StandardLevel"
                                                OnClientClick="SubmitOnClientClick(this, 'StandardLevel');" runat="server" OnClick="btnSubmit_Click" /></span>
                                        &nbsp;&nbsp;<asp:Button runat="server" ID="btnAddNew" Text="New" OnClick="btnAddNew_Click" />
                                        &nbsp;&nbsp;<asp:Button runat="server" ID="btnDelete" OnClientClick="return confirm('Are you sure to delete?');"
                                            Text="Delete" OnClick="btnDelete_Click" />
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                                <div class="row_curved" id="divMessage" runat="server">
                                    <label>
                                        &nbsp;</label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:Label ID="lblMessage" Font-Bold="true" runat="server"></asp:Label>
                                        </span>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                            </td>
                        </tr>
                    </table>
                </fieldset>
            </div>
        </div>
    </div>

    <script type="text/javascript">
        //<![CDATA[
        SetSumitNormalButtonAttribute(document.getElementById('<%=btnSubmit.ClientID%>'));
        //]]>
    </script>

</asp:Content>
